<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button data-action="save">btn1</button>
    <button data-action="edit">btn2</button>
    <button data-action="del">btn3</button>
    <script>
        document.onclick = function (e) {
            const target = e.target;
            const action = target.dataset.action;

            if (action === 'save') {
                console.log('save');
            }
            if (action === 'edit') {
                console.log('edit');
            }
            if (action === 'del') {
                console.log('del');
            }
        }



    </script>

</body>

</html>